package com.jnxx.okr.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.jnxx.basic.domain.BaseDomain;
import com.jnxx.okr.vo.AddOkrAlignmentVo;
import com.jnxx.task.domain.Cycle;
import com.jnxx.task.domain.OkrStaff;
import com.jnxx.task.domain.Task;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 实体类：
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Okr extends BaseDomain{

    private String name;
    /**
     * 周期id
     */
    private Long cycleId;
    // 父任务id
    private Long parentId;
    // 负责人id
    private Long leader;
    private OkrStaff okrLeader;
    /**
     * 类型 0为公司级 1为个人级
     */
    private String type;
    // 进度
    private Integer progress;
    // okr进度
    private Integer parentProgress;
    // 子任务KR序列号
    private String content;

    private Integer alignmentProgress;

    private Cycle cycle;

    /**
     * 对齐id
     */
    private List<OkrStaff> staffList;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<Okr> subOkrList = new ArrayList<>();
    private List<Renew> renewList;

    private List<Task> taskList;

    private Long alignmentId;
    private Date creatTime = new Date();
    private Long creatStaffId;
    private Long[] ids;

    private String okrName;

    private Kr kr;
    // 对齐集合
    private List<Alignment> alignmentList;
    // 被对齐集合
    private List<Alignment> alignments;

    private AddOkrAlignmentVo addOkrAlignmentVo;

    private String leaderName;

    private List<Okr> alignmentForOkrList;

    public Boolean getSelected() {
        return false;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getCycleId() {
        return cycleId;
    }

    public void setCycleId(Long cycleId) {
        this.cycleId = cycleId;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Long getAlignmentId() {
        return alignmentId;
    }

    public void setAlignmentId(Long alignmentId) {
        this.alignmentId = alignmentId;
    }

    @Override
    public String toString() {
        return "Okr{" +
        ", name=" + name +
        ", cycleId=" + cycleId +
        ", type=" + type +
        ", alignmentId=" + alignmentId +
        "}";
    }
}
